abstract class APICode{
  static int serviceFail = 0;
  static int success = 1;
  static int unlogin = 2;

}

class BaseApiModel<T>{
  int code;
  String message;
  T result;
  BaseApiModel(int code,String message,result){
    this.code = code;
    this.message = message;
    this.result = result;
  }

  bool success(){
    return code == success;
  }

  static BaseApiModel json2Object(Map<String, dynamic> json){
    return BaseApiModel(json['code'],json['message'],json['result']);
  }

}